package net.cassandraview.db;

import org.apache.cassandra.thrift.Column;

import java.nio.ByteBuffer;
import java.util.Iterator;
import java.util.List;
import java.util.Map;

/**
 * Result of database query
 *
 * User: nagakhl
 * Date: 21.01.12
 * Time: 21:39
 */
public class Result implements Iterable<ByteBuffer> {

    private Map<ByteBuffer, List<Record>> data;

    @Override
    public Iterator<ByteBuffer> iterator() {
        return data.keySet().iterator();  //To change body of implemented methods use File | Settings | File Templates.
    }

    public static class Record {
        private ByteBuffer key;
        private List<Column> columns;

        public List<Column> getColumns() {
            return columns;
        }

        public void setColumns(List<Column> columns) {
            this.columns = columns;
        }

        public ByteBuffer getKey() {
            return key;
        }

        public void setKey(ByteBuffer key) {
            this.key = key;
        }
    }

}
